package first;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.text.DateFormat;
public class html extends HttpServlet{
	@Override
	protected void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
		response.setContentType("text/html;charset=gbk");
		PrintWriter out=response.getWriter();
		out.println("<html>");
		out.println("<head>");
		out.println("<title>Servlet生成HTML示例</title>");
		out.println("</head>");
		out.println("<body>");
		out.println("<h2>Hello World!</h2>");
		out.println("<h5>Hello World!</h5>");
		out.println("<h5>您好！servlet！</h5>");
		Date nowTime=new Date();
		out.println("<strong>");
		out.println(DateFormat.getInstance().format(nowTime));
		out.println("</strong>");
		out.println("</body>");
		out.println("</html>");
	}
	@Override
	protected void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
	{
		doGet(request,response);
	}
}



